<!doctype html>
<html class="no-js">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <script src="//cdn.bootcss.com/jquery/2.0.2/jquery.min.js"></script>
    <link rel="stylesheet" href="__PUBLIC__/resource/assets/css/amazeui.min.css"/>
    <link rel="stylesheet" href="__PUBLIC__/resource/assets/css/admin.css">
    <style>
        body{overflow-y: auto;font-size: 13px;}
    </style>
</head>
<body>
<div class="hw-content" style="padding: 20px;">
    <form class="am-form am-form-horizontal" action="{:U('Conference/post')}" method="post" id="from1" enctype="multipart/form-data">

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">
                会议名
            </div>
            <div class="am-u-sm-8 am-u-md-4">
                <input type="text" class="am-input-sm" name="name" placeholder="请输入会议名" value="{$data.name}">
            </div>
            <div class="am-hide-sm-only am-u-md-6"></div>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">会议地点</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input type="text" class="am-input-sm" name="address" placeholder="请输入会议地点" value="{$data.address}">
            </div>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">会议内容</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <textarea class="am-u-sm-8 am-u-md-4 am-u-end col-end" name="content" id="" rows="5">{$data.content}</textarea>
            </div>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">海报</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end am-form-file">
                <button type="button" class="am-btn am-btn-default am-btn-sm"><i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                <input type="file" name="banner1" multiple id="doc-form-file">
                <div id="file-list"></div>
            </div>
            <script>
                $(function() {
                    $('#doc-form-file').on('change', function() {
                        var fileNames = '';
                        $.each(this.files, function() {
                            fileNames += '<span class="am-badge">' + this.name + '</span> ';
                        });
                        $('#file-list').html(fileNames);
                    });
                });
            </script>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">Logo</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end am-form-file">
                <button type="button" class="am-btn am-btn-default am-btn-sm"><i class="am-icon-cloud-upload"></i> 选择要上传的文件</button>
                <input type="file" name="logo1" multiple id="file-logo">
                <div id="file-logo-name"></div>
            </div>
            <script>
                $(function() {
                    $('#file-logo').on('change', function() {
                        var fileNames = '';
                        $.each(this.files, function() {
                            fileNames += '<span class="am-badge">' + this.name + '</span> ';
                        });
                        $('#file-logo-name').html(fileNames);
                    });
                });
            </script>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">会议状态</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <label>
                    <input type="radio" name="state" value="1"<if condition="$data['state']==1 or empty($data['state'])"> checked</if> >
                    开启
                </label>
                <label>
                    <input type="radio" name="state" value="2"<if condition="$data['state']==2"> checked</if>>
                    关闭
                </label>
            </div>
        </div>


        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">允许现场报名</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <label>
                    <input type="radio" name="is_site" value="1"<if condition="$data['is_site']==1 or empty($data['is_site'])"> checked</if>>
                    允许
                </label>
                <label>
                    <input type="radio" name="is_site" value="2"<if condition="$data['is_site']==2"> checked</if>>
                    不允许
                </label>
            </div>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">开始时间</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input name="start_time" value="<if condition="!empty($data['start_time'])">{$data.start_time|date='Y-m-d H:i:s',###}</if>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon am-form-field" style="width: 190px;display: inline-block;padding: .5rem;height: 30px;">
            </div>
        </div>

        <div class="am-g am-margin-top">
            <div class="am-u-sm-3 am-u-md-2 am-text-right">结束时间</div>
            <div class="am-u-sm-8 am-u-md-4 am-u-end col-end">
                <input name="end_time" value="<if condition="!empty($data['end_time'])">{$data.start_time|date='Y-m-d H:i:s',###}</if>" onclick="laydate({istime: true, format: 'YYYY-MM-DD hh:mm:ss'})" class="laydate-icon am-form-field" style="width: 190px;display: inline-block;padding: .5rem;height: 30px;">
            </div>
        </div>
        




        <div class="am-g am-margin-top-sm">
            <div class="am-u-sm-8 am-u-sm-offset-3">
                <input type="hidden" name="id" value="{$data.id}">
                <if condition="data.id eq '' ">
                    <button type="button" class="am-btn am-btn-primary">添加会议</button>
                    <else />
                    <button type="button" class="am-btn am-btn-primary">修改会议</button>
                </if>
            </div>
        </div>



    </form>
    <div style="clear: both"></div>
</div>

<!--[if lt IE 9]>
<script src="http://cdn.staticfile.org/modernizr/2.8.3/modernizr.js"></script>
<script src="__PUBLIC__/resource/assets/js/amazeui.ie8polyfill.min.js"></script>
<![endif]-->
<script src="__PUBLIC__/resource/layer/layer.js"></script>
<script src="__PUBLIC__/resource/layer/laydate.js"></script>
<script src="__PUBLIC__/resource/assets/js/amazeui.min.js"></script>
<script src="__PUBLIC__/resource/assets/js/hw-layer.js"></script>
<script src="__PUBLIC__/resource/assets/js/app.js"></script>
<script src="http://malsup.github.io/jquery.form.js"></script>
<script>


    $(".am-btn-primary").click(function () {
        $('#from1').ajaxSubmit(function(data){
            $temp = $.parseJSON(data)
            if($temp['status'] == "200"){
                layer.msg($temp['text'],{icon:1,time:1000},function () {
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.location.reload()
                    parent.layer.close(index);
                })
            }else{
                layer.msg($temp['text'],{icon:2,time:1000});
            }
        });
    })
</script>
</body>
</html>
